<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width,initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
    <title>八维贷</title>
    <script src="https://unpkg.com/vue/dist/vue.js"></script>
    <script src="https://unpkg.com/axios/dist/axios.min.js"></script>
    <link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">
    <script src="https://unpkg.com/element-ui/lib/index.js"></script>
</head>
<body>
    <div id="app">
        <center>
            <div>
                <el-form style="margin-top: 30%">
                    <img src="logo.png" width="80%">
                    <el-form-item label="手机号">
                        <el-input v-model="user.mobile" style="width: 75%"></el-input>
                    </el-form-item>
                    <el-form-item v-show="flag==1" label="密码" >
                        <el-input v-model="user.password" style="width: 75%"></el-input>
                    </el-form-item >
                    <el-form-item v-show="flag==2"label="验证码" >
                        <el-input v-model="user.code" style="width: 35%;margin-right: 5%" ></el-input><el-button type="warning" style="width: 35%">发送验证码</el-button>
                    </el-form-item>
                </el-form>
                <div>
                    <el-button type="success" @click="login">登陆</el-button>
                    <el-button type="primary" @click="register">去注册</el-button>
                    <br>
                    <br>
                    <div v-show="flag==2" @click="flag = 1">切换密码登陆</div>
                    <div v-show="flag==1" @click="flag = 2">切换验证码登陆</div>
                </div>
            </div>
            <div style="width: 100%;position: absolute;bottom: 0">
                <hr>
                www.bwyjs.com @
                云计算1810A
                <hr>
            </div>
        </center>
    </div>
    <script>
        new Vue({
            el:'#app',
            data() {
                return {
                    flag: 2,
                    user:{
                        mobile:'18500240660',
                        password:'',
                        code:''
                    }
                };
            },
            methods: {
                login(){
                    localStorage.setItem("mobile",this.user.mobile)
                    location.href="main.html"
                },
                register(){
                    location.href="register.html";
                }
            }
        })
    </script>
</body>
</html>